package com.ljs.myquartz.testWays;

import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.util.Date;
@Slf4j
public class SimpleJob1 implements Job {
    private String name;

    public void setName(String name) {
        this.name = name;
    }
    private void before(){
        System.out.println("任务开始1执行");
    }
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        before();
        System.out.println(" triggered. time is:" + (new Date()));
        log.info("任务开始1执行");
        after();
    }
    private void after(){
        System.out.println("任务结束1执行");
        log.info("任务结束1执行");
    }


}
